package sample2.provider;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * @author YUN
 */
public class MySQLiteOpenHelper extends SQLiteOpenHelper {
	public MySQLiteOpenHelper(Context context) {
		super(context, MyDatabase.DATABASE_NAME, null, MyDatabase.DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		new MyDatabase.MyTable(db).create();
		new MyDatabase.MyView(db).create();
	}
	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		new MyDatabase.MyTable(db).drop();
		new MyDatabase.MyView(db).drop();
		onCreate(db);
	}
}
